import { reactive, UnwrapNestedRefs } from "vue";

export default class InertialNavigationSettings {
    private static instance: UnwrapNestedRefs<InertialNavigationSettings> = reactive(new InertialNavigationSettings());
    /**
     * 组合惯导组件
     */
    public static get Default(): UnwrapNestedRefs<InertialNavigationSettings> {
        return this.instance;
    }

    public loadFile(name: any) {
        // name为文件所在位置
        let xhr = new XMLHttpRequest();
        const okStatus = document.location.protocol === "file:" ? 0 : 200;
        xhr.open("GET", name, false);
        xhr.overrideMimeType("text/html;charset=utf-8"); //默认为utf-8
        xhr.send(null);
        return xhr.status === okStatus ? xhr.responseText : null;
    }

    // public Title: string = '组合惯导传感器系统仿真软件';
    public Title: string = this.loadFile("./projectName.config.txt")!;

    public Status: string = '';
}